# -*- coding: utf-8 -*-
from openerp.osv import fields,osv
from openerp.tools.translate import _

class res_company(osv.osv):
    _inherit = 'res.company'
    _columns = {
        'pay_account_ids': fields.one2many('res.pay.account','company_id', 'Payment Accounts'),
    }

class res_pay_account(osv.osv):
    _name = "res.pay.account"
    _description = 'Company payment accounts from customer'
    _columns = {
        'name': fields.char('Name',size=64, translate=True, required=True),
        'pay_method': fields.selection([('pay_method_tt','T/T ( bank wire)'),
                                           ('pay_method_paypal','Paypal'),
                                           ('pay_method_wu','Western Union'),
                                           ('pay_method_dap','D/P（Document Against Payment)'),
                                           ('pay_method_loc','irrevocable Letter of Credit'),
                                           ],'Payment Method'),
        'tt_person': fields.char('Person',size=64),
        'tt_addr': fields.char('Address',size=64),
        'tt_bank_account': fields.char('Bank Account#',size=32),
        'tt_bank_name': fields.char('Bank Name',size=64),
        'tt_bank_addr': fields.char('Bank Address',size=64),
        'tt_bank_swift': fields.char('Bank SWIFT CODE',size=64),
        'dap_memo': fields.char('Memo',size=128),
        'loc_memo': fields.char('Memo',size=128),
        'paypal_email': fields.char('Paypal EMail',size=64),
        'wu_first_name': fields.char('First Name',size=32),
        'wu_last_name': fields.char('Last Name',size=32),
        'wu_iden_no': fields.char('Identification No.',size=64),
        'wu_addr': fields.char('Address',size=64),
        'wu_tel': fields.char('Tel',size=20), 
        'company_id': fields.many2one('res.company', 'Company',
            ondelete='cascade', help="Only if this bank account belong to your company", required=True),       
    }    
        